package com.wq.babysecretary.ui.fragment;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.wq.babysecretary.R;
import com.wq.babysecretary.model.BaBayStoryModel;
import com.wq.babysecretary.presenter.impi.MainPresenterImpl;
import com.wq.babysecretary.ui.activity.BaByMusicActivity;
import com.wq.babysecretary.ui.activity.BaByStoryActivity;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wq on 2017/8/22.
 */

public class HomeFragment extends Fragment implements View.OnClickListener{
    private TextView babyStory;
    private TextView babyMusic;
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_home, container, false);
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
    }

    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        babyStory=(TextView) getActivity().findViewById(R.id.babyStory);
        babyMusic=(TextView) getActivity().findViewById(R.id.babyMusic);
        babyStory.setOnClickListener(this);
        babyMusic.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.babyStory:
                Intent in=new Intent(getActivity(), BaByStoryActivity.class);
                startActivity(in);
                break;
            case R.id.babyMusic:
                Intent inbabyMusic=new Intent(getActivity(), BaByMusicActivity.class);
                startActivity(inbabyMusic);
                break;
        }
    }
}
